adAccount/analytics
Get ad account analytics
Get analytics for the specified <code>ad_account_id</code>, filtered by the specified options. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager. - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days. - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time.
/ad_accounts/{ad_account_id}/analytics
Usage and SDK Samples
curl -X GET \
\
-H "Accept: application/json" \
"https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/analytics?start_date=2013-10-20&end_date=2013-10-20&columns=&granularity=DAY&click_window_days=1&engagement_window_days=56&view_window_days=56&conversion_report_time=TIME_OF_AD_ACTION"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdAccountsApi;
import java.io.File;
import java.util.*;
public class AdAccountsApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: pinterest_oauth2
OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");
// Create an instance of the API class
AdAccountsApi apiInstance = new AdAccountsApi();
String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned
Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly
Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.
try {
array[AdAccountAnalyticsResponse_inner] result = apiInstance.adAccount/analytics(adAccountId, startDate, endDate, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdAccountsApi#adAccount/analytics");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final String adAccountId = new String(); // String | Unique identifier of an ad account.
final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final array[String] columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned
final Granularity granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly
final Integer clickWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
final Integer engagementWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
final Integer viewWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
final String conversionReportTime = new String(); // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.
try {
final result = await api_instance.adAccount/analytics(adAccountId, startDate, endDate, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->adAccount/analytics: $e\n');
}
import org.openapitools.client.api.AdAccountsApi;
public class AdAccountsApiExample {
public static void main(String[] args) {
AdAccountsApi apiInstance = new AdAccountsApi();
String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned
Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly
Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.
try {
array[AdAccountAnalyticsResponse_inner] result = apiInstance.adAccount/analytics(adAccountId, startDate, endDate, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdAccountsApi#adAccount/analytics");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
// Create an instance of the API class
AdAccountsApi *apiInstance = [[AdAccountsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
array[String] *columns = ; // Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null)
Granularity *granularity = DAY; // TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null)
Integer *clickWindowDays = 1; // Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30)
Integer *engagementWindowDays = 56; // Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30)
Integer *viewWindowDays = 56; // Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1)
String *conversionReportTime = TIME_OF_AD_ACTION; // The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION)
// Get ad account analytics
[apiInstance adAccount/analyticsWith:adAccountId
startDate:startDate
endDate:endDate
columns:columns
granularity:granularity
clickWindowDays:clickWindowDays
engagementWindowDays:engagementWindowDays
viewWindowDays:viewWindowDays
conversionReportTime:conversionReportTime
completionHandler: ^(array[AdAccountAnalyticsResponse_inner] output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;
// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";
// Create an instance of the API class
var api = new PinterestRestApi.AdAccountsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var columns = ; // {array[String]} Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned
var granularity = DAY; // {Granularity} TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly
var opts = {
'clickWindowDays': 1, // {Integer} Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
'engagementWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
'viewWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
'conversionReportTime': TIME_OF_AD_ACTION // {String} The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.adAccount/analytics(adAccountId, startDate, endDate, columns, granularity, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class adAccount/analyticsExample
{
public void main()
{
// Configure OAuth2 access token for authorization: pinterest_oauth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
// Create an instance of the API class
var apiInstance = new AdAccountsApi();
var adAccountId = adAccountId_example; // String | Unique identifier of an ad account. (default to null)
var startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
var endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
var columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null)
var granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null)
var clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30)
var engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30)
var viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1)
var conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION)
try {
// Get ad account analytics
array[AdAccountAnalyticsResponse_inner] result = apiInstance.adAccount/analytics(adAccountId, startDate, endDate, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling AdAccountsApi.adAccount/analytics: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdAccountsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned
$granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly
$clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
$engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
$viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
$conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.
try {
$result = $api_instance->adAccount/analytics($adAccountId, $startDate, $endDate, $columns, $granularity, $clickWindowDays, $engagementWindowDays, $viewWindowDays, $conversionReportTime);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AdAccountsApi->adAccount/analytics: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdAccountsApi;
# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdAccountsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $columns = []; # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned
my $granularity = DAY; # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly
my $clickWindowDays = 1; # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
my $engagementWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
my $viewWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
my $conversionReportTime = TIME_OF_AD_ACTION; # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.
eval {
my $result = $api_instance->adAccount/analytics(adAccountId => $adAccountId, startDate => $startDate, endDate => $endDate, columns => $columns, granularity => $granularity, clickWindowDays => $clickWindowDays, engagementWindowDays => $engagementWindowDays, viewWindowDays => $viewWindowDays, conversionReportTime => $conversionReportTime);
print Dumper($result);
};
if ($@) {
warn "Exception when calling AdAccountsApi->adAccount/analytics: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Create an instance of the API class
api_instance = openapi_client.AdAccountsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
columns = # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null)
granularity = DAY # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null)
clickWindowDays = 1 # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30)
engagementWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30)
viewWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1)
conversionReportTime = TIME_OF_AD_ACTION # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION)
try:
# Get ad account analytics
api_response = api_instance.ad_account/analytics(adAccountId, startDate, endDate, columns, granularity, clickWindowDays=clickWindowDays, engagementWindowDays=engagementWindowDays, viewWindowDays=viewWindowDays, conversionReportTime=conversionReportTime)
pprint(api_response)
except ApiException as e:
print("Exception when calling AdAccountsApi->adAccount/analytics: %s\n" % e)
extern crate AdAccountsApi;
pub fn main() {
let adAccountId = adAccountId_example; // String
let startDate = 2013-10-20; // date
let endDate = 2013-10-20; // date
let columns = ; // array[String]
let granularity = DAY; // Granularity
let clickWindowDays = 1; // Integer
let engagementWindowDays = 56; // Integer
let viewWindowDays = 56; // Integer
let conversionReportTime = TIME_OF_AD_ACTION; // String
let mut context = AdAccountsApi::Context::default();
let result = client.adAccount/analytics(adAccountId, startDate, endDate, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, &context).wait();
println!("{:?}", result);
}
Scopes
| ads:read | See all of your advertising data, including ads, ad groups, campaigns etc. |
Parameters
| Name | Description |
|---|---|
| ad_account_id* |
String
Unique identifier of an ad account.
Required
|
| Name | Description |
|---|---|
| start_date* |
date
(date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
|
| end_date* |
date
(date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
|
| columns* |
array[String]
Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
Required
|
| granularity* |
Granularity
TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly
Required
|
| click_window_days |
Integer
Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
|
| engagement_window_days |
Integer
Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
|
| view_window_days |
Integer
Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
|
| conversion_report_time |
String
The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.
|